<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="css/mui.min.css">
		<script src="js/mui.min.js"></script>
		<script src="js/update.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a id="info" class="mui-icon mui-icon-info-filled mui-pull-right" style="color: #999;"></a>
			<h1 class="mui-title">Hello mui</h1>
		</header>
		<script>
		
			mui.init({
				swipeBack : false,
				subpages : [{
					id : 'list',
					url : 'list.html',
					styles : {
						top : '48px',
						bottom : 0,
						bounce :'vertical'
						//scrollIndicator : "none"
					}
				}]
			});
			document.getElementById('info').addEventListener('tap', function() {
				mui.openWindow({url:'examples/info.html', id:'info'});
			});
			
			mui.plusReady(function() {
				//首页返回键处理
				//处理逻辑：1秒内，连续两次按返回键，则退出应用；
				var first = null;
				plus.key.addEventListener('backbutton', function(){
					//首次按键，提示‘再按一次退出应用’
					if(!first){
						first = new Date().getTime();
						mui.toast('再按一次退出应用');
						setTimeout(function(){
							first = null;
						},1000);
					}else{
						if(new Date().getTime()-first<1000){
							plus.runtime.quit();
						}
					}
				}, false);
			});
			
		</script>
	</body>
</html>

